home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / amok_lha / amok69.lha / PatternLibrary / pattern.mod < prev    next >
Text File  |  1993-08-15  |  4KB  |  93 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                                                                         *)
  3. (*  Amiga Oberon Library Module: Pattern              Date: 27-Jan-92      *)
  4. (*                                                                         *)
  5. (*   © 1992 by Martin Horneffer                                            *)
  6. (*                                                                         *)
  7. (*   This  Module may freely be copied and distributed, as long as it is   *)
  8. (*   left  unchanged and kept together with "pattern.library", © 1992 by   *)
  9. (*   Angela Schmidt.                                                       *)
  10. (*                                                                         *)
  11. (*-------------------------------------------------------------------------*)
  12.  
  13. MODULE Pattern;
  14.  
  15. IMPORT Exec, Intuition;
  16.  
  17. CONST
  18.   Name* = "pattern.library";
  19.   Version* = 5;
  20.  
  21. VAR
  22.   base * : Exec.LibraryPtr;
  23.  
  24. PROCEDURE ARexxFunction {base,-150}();
  25.  
  26. PROCEDURE Surprise*{base,-36}( window{8}: Intuition.WindowPtr; option{0}: LONGINT);
  27.  
  28. PROCEDURE Str2Upper    *{base,-42}( VAR string{8}    : ARRAY OF CHAR);
  29.  
  30. PROCEDURE Str2Lower    *{base,-48}( VAR string{8}    : ARRAY OF CHAR);
  31.  
  32. PROCEDURE Char2Upper    *{base,-54}( char{0}        : CHAR): CHAR;
  33.  
  34. PROCEDURE Char2Lower    *{base,-60}( char{0}        : CHAR): CHAR;
  35.  
  36. PROCEDURE GetAllocCounter*{base,-66}(): LONGINT;
  37.  
  38. PROCEDURE AllocPattern    *{base,-72}( patternString{8}    : ARRAY OF CHAR;
  39.                                      flags{0}        : LONGINT): LONGINT;
  40.  
  41. PROCEDURE AllocPatternNoCase*{base,-78}( pattern{8}    : ARRAY OF CHAR;
  42.                                          flags{0}    : LONGINT): LONGINT;
  43.  
  44. PROCEDURE IsPattern    *{base,-84}( source{8}        : ARRAY OF CHAR;
  45.                                      VAR dest{9}    : ARRAY OF CHAR;
  46.                                      flags{0}        : LONGINT): BOOLEAN;
  47.  
  48. PROCEDURE ESCPattern    *{base,-90}( source{8}        : ARRAY OF CHAR;
  49.                                      VAR dest{9}    : ARRAY OF CHAR;
  50.                                      flags{0}        : LONGINT): Exec.STRPTR;
  51.  
  52. PROCEDURE MatchThePattern*{base,-96}( pattern{0}    : LONGINT;
  53.                                       string{8}        : ARRAY OF CHAR): LONGINT;
  54.  
  55. PROCEDURE FreePattern    *{base,-102}( pattern{0}    : LONGINT);
  56.  
  57. PROCEDURE SimpleMatch    *{base,-108}( pattern{8}    : ARRAY OF CHAR;
  58.                                       string{9}        : ARRAY OF CHAR): LONGINT;
  59.  
  60. PROCEDURE SimpleMatchNoCase*{base,-114}( pattern{8}    : ARRAY OF CHAR;
  61.                                          string{9}    : ARRAY OF CHAR): LONGINT;
  62.  
  63. PROCEDURE PatternErrorString*{base,-120}( error{0}    : LONGINT;
  64.                                      language{8}    : ARRAY OF CHAR;
  65.                                      VAR buffer{9}    : ARRAY OF CHAR;
  66.                                      buflen{1}        : LONGINT): Exec.STRPTR;
  67.  
  68. PROCEDURE PatternError2DOS*{base,-126}( error{0}    : LONGINT): LONGINT;
  69.  
  70. PROCEDURE XParsePattern    *{base,-132}( source{1}        : ARRAY OF CHAR;
  71.                                      VAR dest{2}    : ARRAY OF CHAR;
  72.                                      destLength{3}    : LONGINT): LONGINT;
  73.  
  74. PROCEDURE XParsePatternNoCase*{base,-138}( source{1}    : ARRAY OF CHAR;
  75.                                      VAR dest{2}    : ARRAY OF CHAR;
  76.                                      destLength{3}    : LONGINT): LONGINT;
  77.  
  78. PROCEDURE XMatchPattern    *{base,-144}( pattern{1}    : ARRAY OF CHAR;
  79.                                      string{2}        : ARRAY OF CHAR): BOOLEAN;
  80.  
  81. PROCEDURE XMatchPatternNoCase*{base,-150}( pattern{1}    : ARRAY OF CHAR;
  82.                                      string{2}        : ARRAY OF CHAR): BOOLEAN;
  83.  
  84. BEGIN
  85.   base := Exec.OpenLibrary( Name, Version);
  86.   IF base=NIL THEN
  87.     IF Intuition.DisplayAlert(0,"\x00\x64\x14missing pattern.library V5!\o\o",50) THEN END;
  88.     HALT(0)
  89.   END;
  90. CLOSE
  91.   IF base#NIL THEN Exec.CloseLibrary(base) END;
  92. END Pattern.
  93.